package com.element.quest;

import tools.XMLParser;
import world.World;

import com.element.ElementList;

public class QuestList extends ElementList{

	private static String xmlPath = "res/raw/questlist.xml";
	
	public QuestList(String id, World world){
		XMLParser parser = new XMLParser();
		parser.setList(id, this, xmlPath, world);
	}
	
	/* Add one or more items to list ql*/
	public void addQuestsById(QuestList ql, World world, String... args){
		for (String id : args) {
			ql.add(new Quest(id, world));
		}
	}
	
	/* Add one or more items to list ql*/
	public void addQuests(QuestList ql, Quest... args){
		for (Quest q : args) {
			ql.add(q);
		}
	}

	/* Remove one or more items from list ql*/
	public void removeQuests(QuestList ql, Quest... args){
		for (Quest q : args) {
			for(int i = 0; i < ql.size(); i++){
				if(ql.get(i) == q){
					ql.remove(i);
				}
			}
		}
	}
}
